#include <iostream>
#include <string>

#include <jsoncpp/json/json.h>
using namespace  std;

struct su
{
    string name;
    int age;
    double weight;
};

int main()
{
    struct su st = {"张三", 18, 70};
    Json::Value root;
    root["name"] = st.name;
    root["age"] = st.age;
    root["weight"] = st.weight;

    Json::StyledWriter writer;
    string str = writer.write(root);

    cout << str;
    return 0;
}